import request from '@/utils/request'

// 查询盘点列表
export function listInventory(query) {
  return request({
    url: 'wh/inventory/list',
    method: 'get',
    params: query
  })
}

// 查询盘点详细
export function getInventory(id) {
  return request({
    url: 'wh/inventory/' + id,
    method: 'get'
  })
}

// 新增盘点
export function addInventory(data) {
  return request({
    url: 'wh/inventory',
    method: 'post',
    data: data
  })
}

// 修改盘点
export function updateInventory(data) {
  return request({
    url: 'wh/inventory',
    method: 'put',
    data: data
  })
}

// 删除盘点
export function delInventory(id) {
  return request({
    url: 'wh/inventory/' + id,
    method: 'delete'
  })
}
// 查询盘点明细列表
export function queryMat(params) {
  return request({
    url: 'wh/inventory/queryStorehouseCode',
    method: 'post',
    params
  })
}
// 查询盘点明细列表
export function listDetail(query) {
  return request({
    url: 'wh/detail/list',
    method: 'get',
    params: query
  })
}

// 查询盘点明细详细
export function getDetail(id) {
  return request({
    url: 'wh/detail/' + id,
    method: 'get'
  })
}

// 新增盘点明细
export function addDetail(data) {
  return request({
    url: 'wh/detail',
    method: 'post',
    data: data
  })
}

// 修改盘点明细
export function updateDetail(data) {
  return request({
    url: 'wh/detail',
    method: 'put',
    data: data
  })
}

// 删除盘点明细
export function delDetail(id) {
  return request({
    url: 'wh/detail/' + id,
    method: 'delete'
  })
}
